<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Didn&apos;t work out',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/07/30.jpg" alt="Trees" class="framed-centred-image" width="649" height="480"/>
<section id="Minetest">
	<h2>Minetest</h2>
	<p>
		To build hype for the <code>palette</code> way of doing things, I started trying to rework the <code>beds</code> mod to allow multiple bed colours.
		I had two options.
		I could convert the mod to use the <code>colorfacedir</code> value for its <code>paramtype2</code>, or use <code>colorwallmounted</code> as the <code>paramtype2</code> value instead.
		The main differences, as I saw it, would be in the difficulty of conversion and the number of bed colours produced.
		After all, either way, only four of the six (in the case of <code>colorwallmounted</code>) or twenty-four (in the case of <code>colorfacedir</code>) facings would be used, due to the <code>beds</code> mod effectively blocking the other facings from normal use.
		Using <code>colorwallmounted</code> would require a whole mess of conversions, especially if I wanted to preserve compatibility with the original <code>beds</code> $a[API], which I did, but it&apos;d also allow twenty-four extra bed colours above the eight I&apos;d have either way.
		I was plenty satisfied by the eight.
		More than that though, I was reluctant to use my 32-colour palette for something I perceived as perhaps drawing a lot of attention.
		So I started the simple conversion to <code>colorfacedir</code>.
	</p>
	<p>
		I soon realised though that if I couldn&apos;t even stand behind my 32-colour palette, I couldn&apos;t claim it to be universal like I&apos;m trying to make it.
		I fear how users might react to its lack of browns, but if that&apos;s not a design decision I can defend, it&apos;s not a design decision I can go with.
		I decided there was no choice.
		I absolutely had to put in the effort to squeeze as many colours into the <code>beds</code> mod as I could.
		I&apos;d take a look at the result, and if I didn&apos;t like it, it meant I needed to rework the palette.
		Again.
	</p>
	<p>
		I put in a lot of effort and got really close, but then I found a fatal flaw in the <code>colorwallmounted</code> (and regular <code>wallmounted</code>) <code>paramtype2</code> options.
		Textures don&apos;t rotate with the node.
		At all.
		Ever.
		It makes building something complex such as beds utterly impossible.
		I have to use the simple <code>colorfacedir</code> method after all.
		It&apos;s a shame I pretty much finished all the work before finding I wouldn&apos;t work, but I&apos;m glad I tried.
		If I hadn&apos;t, I would&apos;ve likely frequently regretted taking the easy way out, as I wouldn&apos;t&apos;ve known the easy way was the <strong>*only*</strong> way.
	</p>
	<p>
		Another interesting piece of info came into my possession through this little endeavour as well: the <code>colorwallmounted</code> option isn&apos;t nearly as versatile as I once imagined it to be.
		The thing&apos;s useless for anything complex.
		I&apos;ve been worried about my 32-colour palette being good enough, as the size was too strange for me to come up with anything actually good for it.
		However, it&apos;ll only even ever be used with very basic nodes.
		Anything interesting can&apos;t use that palette anyway.
		That significantly diminishes the importance and usefulness of that palette, and therefore, minimises the damage done by being unable to come up with something awe-inspiring to fill its place.
		The palette is good enough for what it can do, and I shouldn&apos;t waste more time on it, given its limited use.
		The 256-colour palette is pretty great.
		The 8-colour palette is completely flawless.
		And those two are the important ones to get right.
	</p>
	<p>
		Starting on the beds mod again, I ran into strange bugs.
		The first, I tracked down to my own code.
		I&apos;d hard-coded the colour-mixer to give yellow items instead of white items when a light greyscale item is needed.
		Oops.
		The next though ...
		When I finally tracked down the next bug, I found it was caused by Minetest handling palette indexes bizarrely.
		The bug caused non-white beds to drop an alternate version of themselves with a different palette index, and when these versions would be placed, they&apos;d convert to stable white beds.
		It looks like the problem is that Minetest doesn&apos;t use <code>0</code> through <code>7</code> as the available palette indexes for <code>colorfacedir</code> nodes as I&apos;d thought.
		Instead, it uses <code>0</code>, <code>32</code>, <code>64</code>, <code>96</code>, <code>128</code>, <code>160</code>, <code>192</code>, and <code>224</code>.
		Basically, it uses the values I&apos;d expect, but multiplied by thirty-two.
		No doubt, the values I&apos;d expect from <code>colorwallmounted</code> items are multiplied by eight from what I&apos;d expect.
	</p>
	<p>
		I thought I was going to need to think about the solution a bit and plan my next move.
		I might need to rearrange the palettes to ensure all three use the same indexes to refer to the same colours.
		That would probably the best way to salvage the colour-mixing code I worked so hard on.
		The logic of the unscrambler will need to be rewritten either way though, either to unscramble based on a new scrambling format or to multiply results.
		If I didn&apos;t reformat the palette and the unscrambling data though, and just go with basic multiplication, I&apos;d need to rework the colour mixer.
		It&apos;d be completely unintuitive and a pain to both build and maintain.
		I had to think for now that reworking the palette scrambling is the better option.
	</p>
	<p>
		Thinking it over didn&apos;t take as long as I thought it would though.
		Salvage the colour-mixing code?
		That&apos;s the least of my concerns!
		The initial scrambling was done for a reason.
		I was completely ignoring that.
		It&apos;s necessary for getting nodes to drop the right colour of items.
		It was absolutely vital that I re-scramble the palette to match how Minetest actually works.
		The fact that re-scrambling would allow me to keep my colour-mixing code as it is was completely collateral benefit.
		It wasn&apos;t not even a factor in what actually needs to happen.
		My course of action was set.
	</p>
	<p>
		Garbage like this is exactly why I shouldn&apos;t release <code>palette</code> until <code>alchemic_palette</code> is complete.
		Trying to build a variety of actual items is revealing problems not visible when only working with the theory and a few test items.
	</p>
	<p>
		I re-scrambled the palette, and while doing so, came up with a way to get brown onto the 32-colour palette without doing anything hacky.
		Sweet!
		I lost my most orangey colour from the 32-colour palette in the process though.
		I think it was a good trade-off, but I could be wrong.
		Either way, I&apos;d have to say the new arrangement makes more sense, so I&apos;m sticking with it for now.
	</p>
</section>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion posts for the day:
	</p>
	<blockquote>
		<p>
			To answer your question, it&apos;s important to distinguish between copyright law, patent law, and trademark law.
		</p>
		<p>
			You say inventions can be trademarked, but they can&apos;t.
			Trademarks are names.
			For example, a company&apos;s name or their name for a specific product would be a trademark.
			Trademarks prevent companies from impersonating each other and deceiving customers.
			They allow customers to know exactly who they&apos;re dealing with, which allows for things such as company reputation and brand loyalty.
			The Pepsi Cola company isn&apos;t allowed to make products and sell them under the name Coca-cola.
			They&apos;re both allowed to sell the same product, cola, but the companies are not allowed to pretend to be one another.
			That&apos;s trademark law.
			As they are a method of preventing deception, I&apos;m not against trademarks.
			We can&apos;t own a name because a name is an idea, but creating a system that lets us &quot;own&quot; names anyway is useful for everyone opposed to fraud.
		</p>
		<p>
			Copyright is a method of censorship.
			You can&apos;t express your ideas if they&apos;re based on the ideas of another.
			Copyright creates an artificial monopoly on a written or otherwise expressed work.
			No one is allowed to create things based on the work, which stagnates culture, as everything is derivative.
			Nothing is truly original.
			It&apos;s all based on ideas from past generations, improved and refined a bit at a time.
			I&apos;m opposed to both censorship and monopolies.
			Therefore, I&apos;m against copyright.
			Culture stagnation seems like a bad thing as well.
		</p>
		<p>
			Finally, we have patent law.
			This is probably what you were talking about with inventions.
			Patent law allows someone to create a monopoly on a broad idea that they supposedly invented.
			It&apos;s worth noting that not all patents are on actual inventions, either.
			For example, there was once a patent on yoga videos.
			The company didn&apos;t invent yoga and didn&apos;t invent videos, but the filming of yoga was allowed to become patented.
			Furthermore, because of how broad patents are, they often cover not only the intended invention, but a bunch of things tangent to the invention, or sometimes even distantly-related to the invention only if you squint your eyes.
			Patent law is incredibly dysfunctional.
			Finally, some companies take out patents on competing ideas that they don&apos;t plan to produce anything with.
			They simply patent them so <strong>*no one*</strong> is allowed to make the product, that way, they can keep the product off the market.
			Assuming patent law was less toxic, only covered what it intended to, and didn&apos;t allow companies to entirely keep products they don&apos;t like out of the market, it&apos;d still be bad though.
			It creates monopolies and it provides &quot;ownership rights&quot; over ideas.
		</p>
		<p>
			So to answer your question, trademark law is good and useful, but patent law is a blight on humanity.
		</p>
	</blockquote>
	<blockquote>
		<p>
			I&apos;m not sure I agree that children act up more in the presence of their primary caregiver.
			Personally, I always feared my mother.
			I never acted out if she was nearby.
		</p>
		<p>
			I wasn&apos;t sure at first about your ambulance example.
			Do they send the paramedics just in case when there&apos;s a crash?
			You&apos;re probably right though.
			They probably only send them once injuries are confirmed or reasonably suspected.
		</p>
		<p>
			I like the subtle difference between your smoking and glacier-melting examples.
			We have undeniable proof the earth is heating up and undeniable proof that heat melts things such as glaciers.
			Cancer is complex though.
			Yes, I believe smoking causes cancer too, but I don&apos;t know any of the science behind it.
			Like you, I take it to be true because medical authorities all seem to agree about it.
		</p>
	</blockquote>
</section>
END
);
